import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/main/home'
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/Login.vue')
    },
    {
      path: '/forgetPassword',
      name: 'forgetPassword',
      component: () => import('@/views/login/ForgetPassword.vue')
    },
    {
      path: '/main',
      name: 'main',
      component: () => import('@/views/Main.vue'),
      children: [
        {
          path: 'signature',
          name: 'signature',
          component: () => import('@/views/common/Signature.vue')
        },
        {
          path: 'home',
          name: 'home',
          component: () => import('@/views/home/Home.vue')
        },
        { // 订单
          path: 'order',
          name: 'order',
          component: () => import('@/views/order/Order.vue'),
          children: [
            { // 运单列表
              path: 'bussinessOrder',
              name: 'bussinessOrder',
              component: () => import('@/views/order/BusinessOrder.vue')
            },
            { // 运单详情
              path: 'bussinessOrderInfo',
              name: 'bussinessOrderInfo',
              component: () => import('@/views/order/BusinessOrderInfo.vue')
            },
            { // 申请费用
              path: 'applyFee',
              name: 'applyFee',
              component: () => import('@/views/order/ApplyFee.vue')
            },
            { // 箱子订单
              path: 'boxOrder',
              name: 'boxOrder',
              component: () => import('@/views/order/BoxOrder.vue')
            },
            { // 预录
              path: 'preRecorded',
              name: 'preRecorded',
              component: () => import('@/views/order/PreRecorded.vue')
            }
          ]
        },
        {
          path: 'contact',
          name: 'contact',
          component: () => import('@/views/contact/Contact.vue')
        },
        {
          path: 'my',
          name: 'my',
          component: () => import('@/views/my/My.vue')
        },
        {
          path: 'orderInfo',
          name: 'orderInfo',
          component: () => import('@/views/common/OrderInfo.vue')
        },
        {
          path: 'chat',
          name: 'chat',
          component: () => import('@/views/common/Chat.vue')
        },
        {
          path: 'userInfo',
          name: 'userInfo',
          component: () => import('@/views/my/UserInfo.vue')
        },
        {
          path: 'eir',
          name: 'eir',
          component: () => import('@/views/eir/Eir.vue')
        },
        {
          path: 'eirInfo',
          name: 'eirInfo',
          component: () => import('@/views/eir/EirInfo.vue')
        },
        {
          path: 'map',
          name: 'map',
          component: () => import('@/views/map/Map.vue')
        },
        {
          path: 'help',
          name: 'help',
          component: () => import('@/views/help/Help.vue')
        },
        {
          path: 'publishOrder',
          name: 'publishOrder',
          component: () => import('@/views/common/PublishOrder.vue')
        },
        {
          path: 'setCompleted',
          name: 'setCompleted',
          component: () => import('@/views/setcompleted/SetCompleted.vue')
        },
        { // 应用信息
          path: 'appInfo',
          name: 'appInfo',
          component: () => import('@/views/my/AppInfo.vue')
        },
        { // 客服
          path: 'customer',
          name: 'customer',
          component: () => import('@/views/my/Customer.vue')
        },
        { // 我的钱包
          path: 'wallet',
          name: 'wallet',
          component: () => import('@/views/my/Wallet.vue')
        }
      ]
    }
  ]
})
